<template>
    <view class="page-content">
        <sub-navbar title="系统设置"></sub-navbar>
        <view class="main-view">
            <up-button type="primary" text="退出登录" @click="handleOut"></up-button>
        </view>
        <sub-modal :show="modalShow" title="确定要退出吗?" @confirm="confirm" @cancel="cancel" @close="close"></sub-modal>
    </view>
</template>
<script setup lang="ts">
import { userAppInfo } from '@/store/modules/user';
import { storeToRefs } from 'pinia';
const store = userAppInfo();
const { userInfo } = storeToRefs(store);
const { layout } = store;

const modalShow = ref<boolean>(false);


const handleOut = () => {
    modalShow.value = true;
}

const confirm = (val: boolean) => {
    modalShow.value = val;
    layout();
}
const cancel = (val: boolean) => {
    modalShow.value = val;
}
const close = (val: boolean) => {
    modalShow.value = val;
}
</script>

<style lang="scss" scoped>
.main-view{ 
    flex: 1;
    padding: 0 25rpx;
}
</style>